package sg.java.concepts.passByValue;

/**
 * This class investigates the effects of passing an object as a reference to a
 * method, modifying the object, then checking from the caller if the object is
 * still intact.
 * 
 * <h3>Results:</h3>
 * <p>
 * Car initially set to (hashcode): sg.java.concepts.passByReference.Car@85ee68
 * </p>
 * <p>
 * After calling modifyObject (hashcode): sg.java.concepts.passByReference.Car@85ee68
 * </p>
 * 
 * @author Oh Chin Boon
 * 
 */
public class ObjectPassByValueApp {
	private static void modifyObject(Car car) {
		car = new Car();
	}

	public static void main(String args[]) {
		Car car;

		car = new Car();

		System.out.println("Car initially set to (hashcode): " + car);

		modifyObject(car);

		System.out.println("After calling modifyObject (hashcode): " + car);
	}
}

/**
 * Demonstration class.
 * 
 * @author Oh Chin Boon
 * 
 */
class Car {
}
